<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="css/ui-btn.css">
    <link rel="stylesheet" href="css/ui-input.css">
    <link rel="stylesheet" href="css/ui-base.css">
    <link rel="stylesheet" href="css/ui-box.css">
    <link rel="stylesheet" href="css/ui-color.css">
	<link rel="stylesheet" href="css/ui-res.css">
	<link rel="stylesheet" href="css/ui-img.css">
    <script src="js/zy_control.js"></script>
    <script src="js/zy_click.js"></script>
    <script></script>
</head>
<style>
	.ac-rad{
		-webkit-border-radius: 1em;
		border-radius: 2em;
	}
	.ac-rad-btn{
		-webkit-border-radius: 1em;
		border-radius: 3em;
	}
	.del-line{
		outline:none;
		
	}
</style>
<body class="um-vp c-wh" style="background-color:#347ba9" ontouchstart>
    <div id="page_0" class="up ub ub-ver" tabindex="0">
 
	   <div class="ub-f1">
	   
		<div ontouchstart="zy_touch('btn-act')" class="btn  ac-rad  uinn5 c-bla uc-a t-wh " style="width:4em;opacity:0.35;position:relative;left:3em;top:4em;">取消</div>
	   </div>
        <div id="content" class="ub ub-f1 ub-ver  t-bla ">
           <div class="ub-f1">
            	<div class="ub ac-rad c-wh" style="margin-left:2.5em;margin-right:2.5em">
            		<div class="imgMe2 ub-f1" style="position:relative; left:0.45em"></div>
					<div class="ub-f1 ac-rad c-wh uba b-wh  uinput uinn4">    
 						<input id="name" class="del-line"  placeholder="用户名" type="text">   
					</div>  
				</div>
			</div>
			<div class="ub-f1">
            	<div class="ub ac-rad c-wh" style="margin-left:2.5em;margin-right:2.5em">
            		<div class="imgPas2 ub-f1" style="position:relative; left:0.45em"></div>
					<div class="ub-f1 ac-rad c-wh uba b-wh  uinput uinn4">    
 						<input id="password" type="password" class="del-line" placeholder="密码" type="text">   
					</div>  
				</div>
			</div>
			
			<div class="ub-f1">
			<div ontouchstart="zy_touch('btn-act')" class="btn uba t-wh uinn5  ac-rad-btn" onclick="login()" style="border-color:#71afd6;margin-left:3em;margin-right:3em; background-color:#71afd6">登录</div>
			</div>
        </div>
     	<div class="ub-f1"></div>
    </div>
</body>
<script>
zy_init();
window.uexOnload = function(type){
    if (!type) {
        zy_con("content", "login.html_content", 0, $$("header").offsetHeight);
    }
	window.onorientationchange=window.onresize=function(){
		zy_resize("content",0,$$("header").offsetHeight);				
	}
}
function openPerCenter(){
	uexWindow.open("percenter",0,"percenter.html",0,"","",0);
}
function login(){
	var txtname=$$("name").value;
	var txtPswd=$$("password").value;
	if(txtname==null||txtPswd==null){
		uexWindow.toast(1,5,"密码和用户名不能为空",500);
	}
	var httpID=997;
	uexXmlHttpMgr.onData=function(inOpCode,inStatus,inResult){
		if(inStatus=1){
				var json=JSON.parse(inResult);
				if(json["success"])
				{
					uexWindow.toast(1,5,"登入成功。",1000);
					window.localStorage.setItem("username",json["username"]);
					window.localStorage.setItem("password",json["password"]);
					window.localStorage.setItem("session_id",json["session_id"]);
					uexWindow.open("index",0,"index.html",5,"","",0,600);
				}
				else{
					uexWindow.toast(1,5,"登入失败。",1000);
				}
			}
	}
	uexXmlHttpMgr.open(httpID,'post','http://tm.ourstu.com/api.php/public/login',3000);
	uexXmlHttpMgr.setPostData(httpID,'0','username',txtname);
	uexXmlHttpMgr.setPostData(httpID,'0','password',txtPswd);
	uexXmlHttpMgr.send(httpID);
}
</script>
</html>
